﻿using System;
using System.Linq;
using System.Windows;
using Microsoft.Phone.Controls;
using PhoneAppRssReader.Entity;
using PhoneAppRssReader.Utls;

namespace PhoneAppRssReader
{
    public partial class Setup
    {
        public Setup()
        {
            InitializeComponent();
        }

        private void AddRss(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/AddRssPage.xaml", UriKind.Relative));
        }

        private void AddSampleData(object sender, RoutedEventArgs e)
        {
            var success = XmlAction.SaveFeed(FeedSource.GetSampleDataRss());
            if (!success) return;
            //Reload LoadData in App._source
            App.Source.IsDataLoad = false;

            MessageBox.Show("Load Sample data success");
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
    }
}
